<template>
  <div class="bg-w">
    <div class="container flex-al">
      <!-- <build-el-bread></build-el-bread> -->
      <div class="w100 report flex-al">
        <div class="build-active-promember-home container">
          <div class="container-title">
            <buildElH1 name="往届公示名单.png"></buildElH1>
          </div>
          <div class="promember-home-box">
            <buildElTimeList @handYear="handYear"></buildElTimeList>
            <div class="lin-r"></div>
            <buildElTimeRight :list="tableData"></buildElTimeRight>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import buildElBread from '@/components/build-el-bread'
import buildElH1 from '@/components/build-el-h1'
import buildElTimeList from '@/components/build-el-time-list'
import buildElTimeRight from '@/components/build-el-time-right'
export default {
  components: {
    buildElBread,
    buildElH1,
    buildElTimeList,
    buildElTimeRight,
  },
  data() {
    return {
      tableData: [],
    }
  },
  async mounted() {
    let res = await this.api.findHistoryVoteList({
      customizeId: 1,
    })
    if (res.length != 0) {
      let res2 = await this.api.findHistoryVoteArtistList({
        voteId: res[0].id,
      })
      this.tableData = res2
    }
  },
  methods: {
    async handYear(id) {
      let res = await this.api.findHistoryVoteArtistList({
        voteId: id,
      })
      this.tableData = res
      console.log(res)
    },
  },
}
</script>
<style lang="less" scoped>
html {
  background: #eee;
}
.build-active-promember-home {
  .promember-home-box {
    // display: flex;
    .lin-r {
      background-color: #fafafa;
      height: 7px;
      width: 100%;
      margin: 25px 0;
    }
  }
}
</style>
